
#include <cstring>
#include <iostream>

using namespace std;

template <typename T>
class CMath{
public:
	CMath( T const& t1,T const t2 ) : m_t1(t1), m_t2(t2){}
	T add( ){
		return m_t1 + m_t2;
	}
private:
	T m_t1;
	T m_t2;
};

/*
template<>class CMath<char* const>{
public:
	CMath<char* const>(char* const& t1, char* const& t2) : m_t1(t1), m_t2(t2){}
	char* const add(){
//		return m_t1 + m_t2;
		return strcat( m_t1, m_t2 );
	}
private:
	char* const m_t1;
	char* const m_t2;
};
*/

template<>char* const CMath<char* const>::add( ){
	return strcat(m_t1, m_t2);
}

int main( ) {
	int nx = 10, ny = 20;
	CMath<int> m1(nx, ny);
	cout << m1.add( ) << endl;

	double dx = 1.23, dy = 2.33;
	CMath<double> m2(dx, dy);
	cout << m2.add( ) << endl;

	char cx[256] = "Hello", cy[256] = " World";
	CMath<char* const> m4( cx, cy );
	cout << m4.add( ) << endl;

	return 0;
}
